GenAI Utils | Embedding Type and Span Creation#4219
Conversation
4b4e710 to
e16f49f
Compare
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
lmolkova
left a comment
There was a problem hiding this comment.
tried it with with OpenAI instrumentation and left a couple of comments.
Looks good otherwise!
* gen-requirements: stay with virtualenv < 21 No idea what's going on but looks like hatch / hatchling has issues with latest virtualenv 21: Environment `hatch-build` is incompatible: module 'virtualenv.discovery.builtin' has no attribute 'propose_interpreters' * Update gen-requirements.txt Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com> --------- Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
…lemetry#4246) * fix(threading): attribute error when run is called w/o start * update changelog * don't initialize context on run, fix tests * address styling comments * remove no-op context attachment
…emetry#4253) * [google-genai] Test instrumentation on google-genai v1.63.0 * Add package version upper bound * bump latest version for python 3.9 * fix README * bump google-auth version for python 3.9 * add package upper limit to pyproject.toml * [google-genai] Test instrumentation on google-genai v1.64.0 * fix upper case method in cassette not matching lower case one generated by aiohttp * fix async calls hanging in vcrpy * Remove package upper limit * fix import error in python 3.9 * fix google-genai module lower bound * Add link to vcr issue * Add comment about request method * Fix lint errors * Fix spellcheck --------- Co-authored-by: Aaron Abbott <aaronabbott@google.com>
lmolkova
left a comment
There was a problem hiding this comment.
Let's make sure we don't throw in instrumentation code and also, can we avoid having start_{type}, end_{type}, fail_{type} - we can just have start, stop, fail for all of them
Langchain, anthropic and openai_v2 instrumentation all have called the start_llm, fail_llm and stop_llm methods. So I prefer to keep these for now and same for embedding type right now. If we want to remove them all later we can create a separate ticket. |
lmolkova
left a comment
There was a problem hiding this comment.
LGTM with a caveat around removing stop|fail_embedding methods
Description
This PR adds initial embedding lifecycle coverage, to add metrics in the next PR.
Type of change
How Has This Been Tested?
Ran from repo root with local package path:
PYTHONPATH=util/opentelemetry-util-genai/src pytest -q util/opentelemetry-util-genai/tests/test_utils.py
PYTHONPATH=util/opentelemetry-util-genai/src pytest -q util/opentelemetry-util-genai/tests/test_handler_metrics.py
Results:
[test_utils.py]: 23 passed
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.